function getSum(data) {
    var sum = 0;
    // 拿出所有的数字
    // 拿出每个数组项中的所有的数字
    // 先拿数组项
    for (var i = 0; i < data.length; i++) {
        var item = data[i]; // { name: 'xxx', students: [...] }
        // 小数组: item.students
        // 想拿到1, 2, 3, 4, 5
        // 先拿到{ name: 'zs1', score: 1 }
        for (var j = 0; j < item.students.length; j++) {
            var student = item.students[j]; // { name: 'zs1', score: 1 }
            // 1: student.score
            sum += student.score;
        }
    }
    return sum;
}

const data = [
    {
        name: '于老师',
        students: [
            { name: 'zs1', score: 1 },
            { name: 'zs2', score: 2 },
            { name: 'zs3', score: 3 },
            { name: 'zs4', score: 4 },
            { name: 'zs5', score: 5 },
        ],
    },
    {
        name: '易老师',
        students: [
            { name: 'ls1', score: 6 },
            { name: 'ls2', score: 7 },
            { name: 'ls3', score: 8 },
            { name: 'ls4', score: 9 },
            { name: 'ls5', score: 10 },
        ],
    },
];
console.log(getSum(data)); // 55
